package com.company.lifecycleCallbacks.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.lang.annotation.Annotation;

/**
 * @Author: zhaopeng
 * @Date: Created in 18:13 2020/9/29
 * @Modified By:
 */
@Component
public class BeanFactoryPostProcessorTest1 implements BeanFactoryPostProcessor ,Ordered {
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println("BeanFactoryPostProcessorTest1");
	}

	@Override
	public int getOrder() {
		Order order = this.getClass().getAnnotation(Order.class);
		return 2;
	}
}
